#ifndef _SHELL_H
#define _SHELL_H

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

#define MAX_CMD_LEN 5000
#define MAX_HIS		10

#define PATH_LENGTH 300
char *currentPath;
char *homeDir;
struct _path {
	char *pathVal;
	struct _path *next;
};
typedef struct _path path;
path *workingPath;

void init();
void prompt();
void readCmdLine(char *line);

struct argNode {
	char *arg;
	struct argNode *next;
};
typedef struct argNode t_args;

struct fileType {
	char *fileName;
	struct fileType *next;
};
typedef struct fileType t_file;

struct singleCmd {
	char *cmd;
	t_args *arguments;
	t_file *inFile;
	t_file *outFile;
	t_file *errMsg;
};
typedef struct singleCmd t_Command;

struct commandLine {
	t_Command *cmd;
	struct commandLine *next;
};
typedef struct commandLine t_CmdLine;

int parse(t_CmdLine*, char*);
int execute(t_CmdLine*);

#endif
